import type { AppRouteRecordRaw } from '../types'

// 基础路由（不需要权限验证）
export const basicRoutes: AppRouteRecordRaw[] = [
	{
		path: '/',
		name: 'index',
		redirect: '/layout',
		meta: {
			title: '首页',
			hidden: true,
		},
	},
	{
		path: '/layout',
		name: 'layout',
		component: () => import('@/layout/index.vue'),
		redirect: '/home',
		meta: {
			title: '布局',
			icon: 'layout',
			requiresAuth: true,
			keepAlive: false,
			affix: true,
		},
		children: [
			{
				path: '/home',
				name: 'home',
				component: () => import('@/views/pages/home/Home.vue'),
				meta: {
					title: '主页',
					requiresAuth: true,
					keepAlive: false,
					icon: new URL('@/assets/home/jiedu.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/shouye-2.png', import.meta.url)
						.href,

					affix: true,
				},
				children: [
					{
						path: '/home/kpdt',
						name: 'kpdt',
						component: () => import('@/views/pages/kpdt/index.vue'),
						meta: {
							title: '快评动态',
							requiresAuth: true,
              // keepalive导致子页面重复挂载
							keepAlive: false,
							affix: true,
							hidden: true,
						},
						children: [
							{
								path: '/home/kpdt/kxxq',
								name: 'kxxq',
								component: () =>
									import('@/views/pages/kpdt/DetailedDisplayKX.vue'),
								meta: {
									title: '快讯详情',
									requiresAuth: true,
									keepAlive: false,
									affix: true,
									hidden: true,
								},
							},
              {
								path: '/home/kpdt/sjjdxq',
								name: 'sjjdxq',
								component: () =>
									import('@/views/pages/kpdt/DetailedDisplaySJJD.vue'),
								meta: {
									title: '数据解读详情',
									requiresAuth: true,
									keepAlive: false,
									affix: true,
									hidden: true,
								},
							},
						],
					},
					{
						path: '/home/sjzb',
						name: 'sjzb',
						component: () => import('@/views/pages/sjzb/index.vue'),
						meta: {
							title: '数据周报',
							requiresAuth: true,
							keepAlive: true,
							affix: true,
							hidden: true,
						},
						children: [
							{
								path: '/home/kpdt/zbxq',
								name: 'zbxq',
								component: () => import('@/views/pages/sjzb/ZBXQ.vue'),
								meta: {
									title: '周报详情',
									requiresAuth: true,
									keepAlive: false,
									affix: true,
									hidden: true,
								},
							},
						],
					},
				],
			},
			{
				path: '/read',
				name: 'read',
				component: () => import('@/views/pages/Read.vue'),
				meta: {
					title: '解读',
					requiresAuth: true,
					keepAlive: false,
					affix: true,
					icon: new URL('@/assets/home/jiedu.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/shouye-2.png', import.meta.url)
						.href,
				},
			},
			{
				path: '/activity',
				name: 'activity',
				component: () => import('@/views/pages/Activity.vue'),
				meta: {
					title: '活动',
					requiresAuth: true,
					keepAlive: false,
					affix: true,
					icon: new URL('@/assets/home/huodong.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/shouye-2.png', import.meta.url)
						.href,
				},
			},
			{
				path: '/team',
				name: 'team',
				component: () => import('@/views/pages/team/Team.vue'),
				meta: {
					title: '团队',
					requiresAuth: true,
					keepAlive: false,
					affix: true,
					icon: new URL('@/assets/home/wode.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/tuandui.png', import.meta.url).href,
				},
        children: [
							{
								path: '/team/grzy',
								name: 'grzy',
								component: () => import('@/views/pages/team/GRZY.vue'),
								meta: {
									title: '个人主页',
									requiresAuth: true,
									keepAlive: false,
									affix: true,
									hidden: true,
								},
							},
						],
			},
			{
				path: '/my',
				name: 'my',
				component: () => import('@/views/pages/my/pcperson/index.vue'),
				meta: {
					title: '我的',
					requiresAuth: true,
					keepAlive: false,
					affix: true,
					icon: new URL('@/assets/home/wode.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/shouye-2.png', import.meta.url)
						.href,
				},
			},
      
			{
				path: '/my2',
				name: 'my2',
				component: () => import('@/views/pages/my/cpersonal/index.vue'),
				meta: {
					title: '我的',
					requiresAuth: true,
					keepAlive: false,
					affix: true,
					icon: new URL('@/assets/home/wode.png', import.meta.url).href,
					iconCheck: new URL('@/assets/home/shouye-2.png', import.meta.url)
						.href,
				},
			},
			// {
			// 	path: '/mediaQueryExample',
			// 	name: 'mediaQueryExample',
			// 	component: () => import('@/views/pages/MediaQueryExample.vue'),
			// 	meta: {
			// 		title: '媒体查询',
			// 		requiresAuth: true,
			// 		keepAlive: false,
			// 		affix: true,
			// 	},
			// },
		],
	},
]
